/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package it.iubar.tkdscore.jinput;

import java.io.PrintStream;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.Version;

/**
 *
 * @author borgo
 */
public class JInputUtils {


   public void  test2(){
System.out.println("JInput version: " + Version.getVersion());
ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment();
Controller[] cs = ce.getControllers();
// print the name and type of each controller
for (int i = 0; i < cs.length; i++){
System.out.println(i + ". " + cs[i].getName() + ", " + cs[i].getType() );
}
    }


  public static void listControllers() {
    System.out.println("JInput version: " + Version.getVersion());

    ControllerEnvironment ce =
         ControllerEnvironment.getDefaultEnvironment();
    Controller[] cs = ce.getControllers();

    if (cs.length == 0) {
      System.out.println("No controllers found");
      System.exit(0);
    }

    // print the name and type for each controller
    for (int i = 0; i < cs.length; i++)
      System.out.println(i + ". " +
             cs[i].getName() + ", " + cs[i].getType() );
  } // listControllers

   


} // end class
